<?php
/**
 * @Name: RoleModel.php
 * @Author: yashuai<1762910894@qq.com>
 */

namespace app\common\model\rbac;

use app\common\model\BaseModel;

class RoleModel extends BaseModel
{

    /**
     * 数据表主键
     * @var string
     */
    protected $pk = 'RoleID';

    /**
     * 数据表名
     * @var string
     */
    protected $table = 'db_admin_role';

    public function node()
    {
        return $this->hasMany(RoleNodeModel::class, 'RoleID', 'RoleID')
            ->field(['RoleID', 'NodeID']);
    }

}
